package org.example.sword2offer.primary;

/**
 * @author: lynn
 * @Descript: 矩形覆盖,先竖着放一个或者先横着放两个，剩下的交给递归处理：
 * Question 11
 * @date: 2021/3/8 23:23
 * @version: 1.0
 */
public class Q11_RectCover {
    public static void main(String[] args) {
        System.out.println(doCover(3));
    }


    //target 大矩形的边长，也是剩余小矩形的个数
    public static int doCover(int target){
        if (target<0){
            throw new IllegalArgumentException("输入参数非法！");
        }
        if (target<=2){
            return target;
        }
        return doCover(target-1)+doCover(target-2);
    }
}
